<div class="hr-line-dashed"></div>
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
    <label class="col-sm-2 control-label">角色名称</label>
    <div class="col-sm-10">
        <input class="form-control" type="text" name="name" value="{{ $name }}">
        <span class="help-block m-b-none">角色的唯一名称，如“admin”，“owner”，“employee”等</span>
    </div>
</div>

<div class="hr-line-dashed"></div>
<div class="form-group{{ $errors->has('display_name') ? ' has-error' : '' }}">
    <label class="col-sm-2 control-label">角色别名</label>
    <div class="col-sm-10">
        <input class="form-control" type="text" name="display_name" value="{{$display_name}}">
        <span class="help-block m-b-none">人类可读的角色名，例如“后台管理员”、“作者”、“雇主”等</span>
    </div>
</div>

<div class="hr-line-dashed"></div>
<div class="form-group">
    <label class="col-sm-2 control-label">角色描述</label>
    <div class="col-sm-10">
        <textarea name="description" class="form-control">{{$description}}</textarea>
        <span class="help-block m-b-none">该角色的详细描述</span>
    </div>
</div>

<div class="hr-line-dashed"></div>
<div class="form-group">
    <label class="col-sm-2 control-label">权限列表:</label>
</div>

<div class="form-group">
    @if($permissionAll)
        @foreach($permissionAll[0] as $v)
                <label class="control-label col-sm-2 all-check">
                    {{$v['display_name']}}
                </label>
                <div class="col-sm-10">
                    @if($permissionAll[$v['id']] )
                        @foreach($permissionAll[$v['id']] as $vv)
                            <div class="col-md-3" style="float:left;padding-left:20px;margin-top:8px;">
                        <span class="checkbox-custom checkbox-default">
                        <i class="fa"></i>

                            <input class="form-actions"
                                   @if(in_array($vv['id'],$perms))
                                   checked
                                   @endif
                                   id="inputChekbox{{$vv['id']}}" type="Checkbox" value="{{$vv['id']}}"
                                   name="permissions[]"> <label for="inputChekbox{{$vv['id']}}">
                                {{$vv['display_name']}}
                            </label>
                        </span>
                            </div>
                        @endforeach
                    @endif
                </div>
        @endforeach
    @endif
</div>

<div class="hr-line-dashed"></div>
<div class="form-group">
    <div class="col-sm-4 col-sm-offset-2">
        <button class="btn btn-white" type="reset">取消</button>
        <button class="btn btn-primary" type="submit">提交</button>
    </div>
</div>